package rest.home.conntroller;


import rest.home.entity.*;
import rest.home.entity.ms.Limit;
import rest.home.entity.ms.OlderAndVisitorAndRoom;
import rest.home.service.services.RestHomeService;
import java.util.List;


/**
 * @author: lbc
 * @Date: 2022/5/5 15:17
 * @version: 8.0
 * @describe:  test  testetset
 */
public class RestHomeController {
    RestHomeService rhs=new RestHomeService();
    public boolean login(String userName,String passWord) {
        List<Admin> list = rhs.login();
        boolean flag=false;
        for (Admin admin : list) {
            if (admin.getAdminId().equals(userName) && admin.getPassWord().equals(passWord)) {
                flag=true;
            }
        }
        if (flag){
            return true;
        }
        return false;
    }
    //已有账号的查询
    public List<Admin> findAllAdmin(){
        List<Admin> list = rhs.login();
        return list;
    }

    //新增账号密码
    public Boolean addAdmin(Admin admin){
        return rhs.addAdmin(admin);
    }

    //2.1、查询老人信息
    public List<Older> findAll(){
        List<Older> list = rhs.findAll();
        return list;
    }


    //2.2、修改老人信息
    public Integer updateOlder(Older older){
        return rhs.updateOlder(older);
    }

    //展示房间的信息
    public List<Room> ShowRoom() {
        List<Room> list = rhs.showRoom();
        return list;
    }

    //添加老人
    public Boolean addOlder(Older older){
        return rhs.addOlder(older);
    }

    //删除老人
    public Boolean deleteOlder(Integer deleteOlderId){
        return rhs.deleteOlder(deleteOlderId);
    }

    //根据老人ID查询老人信息
    public Older findOlderIdByOlder(Integer olderId){
        return rhs.findOlderIdByOlder(olderId);
    }

    //展示所有的房间信息
    public List<Room> showRoom() {
        return rhs.showRoom();
    }


    //展示可用的房间信息
    public List<Room> showRoomByStatus() {
        return rhs.showRoomByStatus();
    }
    //修改房间信息
    public Integer updateRoomMessage(Room room){
        return rhs.updateRoomMessage(room);
    }
    public List<Room> showRoomByType(String typeName) {
        return rhs.showRoomByType(typeName);
    }
    //添加房间信息
    public Integer addRoomMessage(Room room) {
        return rhs.addRoomMessage(room);
    }
    //删除一条房间信息
    public Boolean deleteRoomMessage(Integer id) {
        return rhs.deleteRoomMessage(id);
    }
        //查看所有事故
    public List<Trouble> findAllTrouble(){
        List<Trouble> ab = rhs.findAllTrouble();
        return ab;
    }
    //修改事故信息
    public Integer updateTroubleById(Trouble trouble){
        Integer tbId = rhs.updateTroubleById(trouble);
        return tbId;
    }
    public Trouble findTroubleById(Integer troubleId){
        return rhs.findTroubleById(troubleId);
    }
    //新增事故信息
    public Boolean addTrouble(Trouble trouble){
        return rhs.addTrouble(trouble);
    }
    public Boolean deleteTrouble(Integer troubleId){
        return rhs.deleteTrouble(troubleId);
    }
    //展示缴费信息
    public List<PayMent> findAllPayMent(){
        return rhs.findAllPayMent();
    }
    //展示所有护理人员信息
    public List<Nurse> findAllNurse(){
        return rhs.findAllNurse();
    }
    //判断护理人员是否存在
    public Nurse existsNurseId(Integer integer){
        return rhs.existsNurseId(integer);
    }
    //判断护理人员是否修改成功
    public Boolean updateNurse(Nurse nurse){
        return rhs.updateNurse(nurse);
    }
    //添加一名护理人员的信息
    public boolean addNurse(Nurse nurse){
        return rhs.addNurse(nurse);
    }
    //删除一名护理人员信息
    public boolean deleteNurse(Integer integer){
        return rhs.deleteNurse(integer);
    }
    //展示所有的健康信息
    public List<Health> showHealthByType() {
        return rhs.showHealthByType();
    }
    //修改一个老人健康信息
    public Boolean updateHealthMessage(Health health){
        return rhs.updateHealthMessage(health);
    }
    //展示所有的药品信息
    public List<Medicine> showMedicine() {
        return rhs.showMedicine();
    }
    //添加一个药品信息
    public Boolean addMedicine(Medicine medicine) {
        return rhs.addMedicine(medicine);
    }
    //修改一个药品信息
    public Boolean updateMedicine(Medicine medicine){
        return rhs.updateMedicine(medicine);
    }
    //删除一个药品信息
    public Boolean deleteMedicine(Integer integer){
        return rhs.deleteMedicine(integer);
    }
    //删除一个药品信息
    public Boolean addHealth(Health health){
        return rhs.addHealth(health);
    }
    //展示护理费用信息
    public List<NursingPayMent> showAllNursing(){
        return rhs.showAllNursing();
    }
    //展示访客信息
    public List<Visitor> showAllVisitor(){
        return rhs.showAllVisitor();
    }
    //根据ID看访客信息
    public Visitor findVistorById(Integer vistorId){
        return rhs.findVisitorById(vistorId);
    }
    //修改访客信息
    public Boolean updateVisitore(Visitor visitor){
        return rhs.updateVisitore(visitor);
    }
    //新增访客
    public Boolean addVisitor(Visitor visitor){
        return rhs.addVisitor(visitor);
    }
    //删除访客
    public Boolean deleteVisitor(Integer visitorId){
        return rhs.deleteVisitor(visitorId);
    }
    //查询缴费状态
    public List<PayMent> findOlderByStatus(Integer olderId){
        return rhs.findOlderByStatus(olderId);
    }
    //查看外出信息
    public List<Outing> showAllOuting(){
        return rhs.showAllOuting();
    }
    //外出报备
    public Boolean addOuting(Outing outing){
        return rhs.addOuting(outing);
    }
    //外出归来修改报备状态
    public Boolean updateOuting(Outing outing){
        return rhs.updateOuting(outing);
    }
    //判断外出报备ID是否存在
    public Outing existsOutingId(Integer outingId){
        return rhs.existsOutingId(outingId);
    }
    public Limit<OlderAndVisitorAndRoom> OlderAndVisitorAndRoomByPage(Integer index){
        return rhs.OlderAndVisitorAndRoomByPage(index);
    }
}
